import React, { Component, createRef } from 'react'
import "./Loginref.css"

export default class Loginref extends Component {
    input  = React.createRef()
    input1 = createRef()
    fn = ()=>{
        let username = this.input.current.value
        let pwd = this.input1.current.value
        alert(`账号是:${username} 密码是:${pwd}`)
    }
  render() {
    return (
      <div className='box'>
        <input ref={this.input} type="text" name="" id="" placeholder='请输入账号'/><br />
        <input ref={this.input1} type="text" name="" id="" placeholder='请输入密码' /><br />
        <button onClick={this.fn}>捕获</button>

      </div>
    )
  }
}
